<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="projects.milestone" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="milestone" class="projects.milestone"></jsp:useBean>
<jsp:setProperty property="*" name="milestone"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<%
	if (session.getAttribute("loggedIn") == null) {
		response.sendRedirect("../User/index.jsp");
		}
%>

<body>

<% 

milestone mil = new milestone();
mil.setMilestoneId(Integer.parseInt(session.getAttribute("milestoneId").toString()));
mil.setMilestoneStateId(Integer.parseInt(request.getParameter("milestoneStateId")));
mil.setMilestoneStateReason(request.getParameter("milestoneStateReason"));
if(mil.updateMilestoneState()){
	session.setAttribute("postback", "true");
	session.setAttribute("changeMilestoneState", "true");
	response.sendRedirect("../Milestones/milestone.jsp"); 
}
else
{
	session.setAttribute("postback", "true");
	session.setAttribute("changeMilestoneState", "false");
	response.sendRedirect("../Milestones/milestone.jsp");
}


%>

</body>
</html>